import React, { Component, lazy, Suspense } from 'react'
import 'antd/dist/antd.css';
// import Count from './components/Count/Count'
// 引入懒加载路由函数 lazy
const Count = lazy(() => import('./components/Count/Count.jsx'))
export default class App extends Component {
    render() {
        return (
            <div>
                <Suspense fallback={<Loading />}>
                    {/* fallback也可以是一个组件,但是这个组件不允许使用懒加载的方式进行引用 */}
                    <Count />
                </Suspense>
            </div>
        )
    }
}
class Loading extends Component {
    render() {
        return (
            <div>
                <h1>加载中</h1>
            </div>
        )
    }
}
